how to use try and catch in javascript